<html>
<head>
    <script src="resources/cross-frame-access.js"></script>
    <script>
        window.onload = function()
        {
            if (window.testRunner) {
                testRunner.dumpAsText();
                testRunner.waitUntilDone();
            }

            window.targetWindow = frames[0];

            log("----- tests for getting a targetWindow's functions which have custom overrides.  The desired " +
                " behavior is for the targetWindow to return the built-in function, not the override -----\n");

            // Overriden using window.focus = function() { return "new focus" }
            shouldBeTrue("canGet('targetWindow.focus')");
            shouldBe("targetWindow.focus.name", "''");

            // Overriden using window.__proto__.blur = function() { return "new blur;" }
            shouldBeTrue("canGet('targetWindow.blur')");
            shouldBe("targetWindow.blur.name", "''");

            // Overriden using window.history.close = "new close"
            shouldBeTrue("canGet('targetWindow.close')");
            shouldBe("targetWindow.close.name", "''");

            if (window.testRunner)
                testRunner.notifyDone();
        }
    </script>
</head>
<body>
<iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get-override-test.html"></iframe>
<pre id="console"></pre>
</body>
</html>
